#define  _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main()
{
    int a = 0;
    scanf("%d", &a);
    int arr[] = {0};
    int i = 0;
    for (i = 0; i < a; i++)
    {
        scanf("%d", &arr[i]);
    }
    int kit = 0;
    int b = 0;
    int j = 0;
    scanf("%d", &kit);
    for (b = 0; b < a; b++)
    {
        if (kit != arr[b])
        {
            arr[j++] = arr[b];
        }

    }
    return 0;
}